<template>
  <div class="home-solutions">
    <div class="section-header">
      <h2 class="section-title">解决方案</h2>
      <p class="section-desc">为您提供全方位的专业解决方案，助力企业数字化转型</p>
    </div>
    <el-row :gutter="30">
      <el-col 
        :xs="24" 
        :sm="24" 
        :md="8" 
        v-for="(item, index) in solutionList" 
        :key="index"
        class="solution-col"
      >
        <div class="solution-card" :class="{ 'active': activeCard === index }" @mouseenter="activeCard = index" @mouseleave="activeCard = null">
          <div class="card-content">
            <div class="solution-icon" :class="'icon-' + index">
              <el-icon :size="50"><component :is="item.icon" /></el-icon>
            </div>
            <div class="solution-info">
              <h3>{{ item.title }}</h3>
              <p>{{ item.description }}</p>
            </div>
            <router-link :to="item.path" class="learn-more">
              <span>了解更多</span>
              <el-icon><ArrowRight /></el-icon>
            </router-link>
          </div>
          <div class="card-background"></div>
        </div>
      </el-col>
    </el-row>
  </div>
</template>

<script setup>
import { ref, onMounted } from 'vue'
import { getSolutionList } from '@/api/home'
import { Monitor, Connection, Cpu } from '@element-plus/icons-vue'
import { ArrowRight } from '@element-plus/icons-vue'

const activeCard = ref(null)

const solutionList = ref([
  {
    title: 'VDI解决方案',
    description: '提供安全、高效的虚拟桌面基础架构解决方案，实现随时随地的办公访问',
    icon: 'Monitor',
    path: '/solutions#vdi'
  },
  {
    title: 'AI解决方案',
    description: '运用先进的人工智能技术，为企业提供智能化业务流程优化方案',
    icon: 'Cpu',
    path: '/solutions#other'
  },
  {
    title: 'LLM解决方案',
    description: '基于大语言模型的智能应用平台，助力企业实现智能化升级转型',
    icon: 'Connection',
    path: '/solutions#llm'
  }
])
</script>

<style lang="scss" scoped>
.home-solutions {
  padding: 80px 0;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  
  .section-header {
    text-align: center;
    margin-bottom: 60px;
    
    .section-title {
      font-size: 42px;
      font-weight: 800;
      color: #2c3e50;
      margin-bottom: 20px;
      position: relative;
      display: inline-block;
      
      &::after {
        content: '';
        position: absolute;
        bottom: -10px;
        left: 50%;
        transform: translateX(-50%);
        width: 80px;
        height: 4px;
        background: linear-gradient(90deg, #ff6b6b, #ff8e8e);
        border-radius: 2px;
      }
    }
    
    .section-desc {
      font-size: 18px;
      color: #6c757d;
      max-width: 600px;
      margin: 0 auto;
      line-height: 1.6;
    }
  }

  .solution-col {
    margin-bottom: 30px;
  }

  .solution-card {
    position: relative;
    height: 380px;
    border-radius: 20px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.5s ease;
    
    &:hover {
      transform: translateY(-10px);
      
      .card-background {
        transform: scale(1.1);
      }
      
      .solution-icon {
        transform: translateY(-10px);
      }
      
      .learn-more {
        opacity: 1;
        transform: translateY(0);
      }
    }
    
    .card-content {
      position: relative;
      z-index: 2;
      height: 100%;
      padding: 40px 30px;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      background: rgba(255, 255, 255, 0.9);
      backdrop-filter: blur(10px);
    }
    
    .card-background {
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      z-index: 1;
      transition: transform 0.5s ease;
      background: linear-gradient(45deg, #ff6b6b 0%, #ff8e8e 100%);
      opacity: 0.1;
    }
    
    .solution-icon {
      margin-bottom: 30px;
      transition: all 0.5s ease;
      padding: 20px;
      border-radius: 50%;
      background: rgba(255, 255, 255, 0.2);
      box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
      
      .el-icon {
        color: #ff6b6b;
      }
    }
    
    &.active .solution-icon {
      transform: translateY(-10px);
      background: rgba(255, 107, 107, 0.1);
    }

    .solution-info {
      text-align: center;
      margin-bottom: 30px;
      
      h3 {
        font-size: 24px;
        font-weight: 700;
        color: #2c3e50;
        margin-bottom: 20px;
        transition: color 0.3s ease;
      }
      
      p {
        font-size: 16px;
        color: #6c757d;
        line-height: 1.8;
        margin-bottom: 0;
      }
    }

    .learn-more {
      display: inline-flex;
      align-items: center;
      padding: 12px 30px;
      background: linear-gradient(45deg, #ff6b6b, #ff8e8e);
      color: #fff;
      text-decoration: none;
      border-radius: 25px;
      font-weight: 600;
      transition: all 0.5s ease;
      opacity: 0.9;
      transform: translateY(10px);
      box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
      
      span {
        margin-right: 8px;
      }
      
      .el-icon {
        transition: transform 0.3s ease;
      }
      
      &:hover {
        transform: translateY(-3px);
        box-shadow: 0 6px 20px rgba(255, 107, 107, 0.4);
        
        .el-icon {
          transform: translateX(5px);
        }
      }
    }
  }
  
  @media (max-width: 768px) {
    padding: 60px 0;
    
    .section-header {
      margin-bottom: 40px;
      
      .section-title {
        font-size: 32px;
      }
      
      .section-desc {
        font-size: 16px;
        padding: 0 20px;
      }
    }
    
    .solution-card {
      height: 340px;
      
      .solution-icon {
        padding: 15px;
        
        .el-icon {
          font-size: 40px;
        }
      }
      
      .solution-info {
        h3 {
          font-size: 20px;
        }
        
        p {
          font-size: 14px;
        }
      }
      
      .learn-more {
        padding: 10px 25px;
        font-size: 14px;
      }
    }
  }
}
</style> 